Skip to content

Conversation

@hulxv
Copy link
Collaborator

@hulxv hulxv commented Sep 19, 2025

This PR adds complete Docker containerization support for the Coinswap project, making it easier to deploy, test, and run all Coinswap components in isolated, reproducible environments.

It will help users run and develop Coinswap without headaches during setup. I added the Docker image and some documentation that explains how to use it

@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.47%. Comparing base (776b75d) to head (59ef24c).
⚠️ Report is 49 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #600      +/-   ##
==========================================
+ Coverage   68.87%   77.47%   +8.59%     
==========================================
  Files          35       49      +14     
  Lines        4932    12766    +7834     
==========================================
+ Hits         3397     9890    +6493     
- Misses       1535     2876    +1341     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@mojoX911 mojoX911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck.

Copy link
Collaborator

@Wukong247 Wukong247 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on caching of steps, usually people miss on that. Left few comments.

@Wukong247
Copy link
Collaborator

@hulxv Please remove the merge commit, we usually rebase PR on top of master.

@hulxv
Copy link
Collaborator Author

hulxv commented Sep 25, 2025

@hulxv Please remove the merge commit, we usually rebase PR on top of master.

I merged it from the master because there are some conflicts, so I needed it to avoid them

@hulxv hulxv requested a review from Wukong247 September 25, 2025 11:50
@hulxv hulxv requested a review from stark-3k October 2, 2025 00:52
Copy link

@stark-3k stark-3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 => ERROR [builder 12/12] RUN --mount=type=cache,target=/root/.cargo/registry     --mount=type=cache,t  1.3s
------                                                                                                       
 > [builder 12/12] RUN --mount=type=cache,target=/root/.cargo/registry     --mount=type=cache,target=/root/.cargo/git     git clone https://github.com/citadel-tech/tracker.git &&     cd tracker &&     cargo build --release &&     cp target/release/tracker /tmp/binaries/:                                                        
0.087 Cloning into 'tracker'...                                                                              
1.333 error: failed to parse manifest at `/tmp/tracker/Cargo.toml`
1.333 
1.333 Caused by:
1.333   feature `edition2024` is required
1.333 
1.333   The package requires the Cargo feature called `edition2024`, but that feature is not stabilized in this version of Cargo (1.75.0 (1d8b05cdd 2023-11-20)).
1.333   Consider trying a newer version of Cargo (this may require the nightly release).
1.333   See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2024 for more information about the status of this feature.
------
Dockerfile.builder:49
--------------------
  48 |     WORKDIR /tmp
  49 | >>> RUN --mount=type=cache,target=/root/.cargo/registry \
  50 | >>>     --mount=type=cache,target=/root/.cargo/git \
  51 | >>>     git clone https://github.com/citadel-tech/tracker.git && \
  52 | >>>     cd tracker && \
  53 | >>>     cargo build --release && \
  54 | >>>     cp target/release/tracker /tmp/binaries/
--------------------
ERROR: failed to solve: process "/bin/sh -c git clone https://github.com/citadel-tech/tracker.git &&     cd tracker &&     cargo build --release &&     cp target/release/tracker /tmp/binaries/" did not complete successfully: exit code: 101
[ERROR] Failed to build builder image

You might need to update the rust version. I recommend you use a rust alpine base image for the builder stage with updated rust version instead of manually installing rust.

@hulxv hulxv requested a review from stark-3k October 9, 2025 16:57
@hulxv
Copy link
Collaborator Author

hulxv commented Oct 9, 2025

@stark-3k I made a CI workflow for testing docker

@stark-3k
Copy link

@stark-3k I made a CI workflow for testing docker

./docker-setup.sh build
[SUCCESS] Docker is available and running
[INFO] Building Coinswap Docker images...
[INFO] Building builder image...
[+] Building 0.3s (3/3) FINISHED                                                        docker:desktop-linux
 => [internal] load build definition from Dockerfile.builder                                            0.0s
 => => transferring dockerfile: 1.80kB                                                                  0.0s
 => CANCELED [internal] load metadata for docker.io/library/alpine:3.18                                 0.3s
 => ERROR [internal] load metadata for docker.io/library/rust:1.82-alpine3.18                           0.3s
------
 > [internal] load metadata for docker.io/library/rust:1.82-alpine3.18:
------
Dockerfile.builder:2
--------------------
   1 |     ## Multi-stage build for coinswap project using Alpine
   2 | >>> FROM rust:1.82-alpine3.18 AS builder
   3 |     
   4 |     # Install system dependencies
--------------------
ERROR: failed to solve: rust:1.82-alpine3.18: failed to resolve source metadata for docker.io/library/rust:1.82-alpine3.18: docker.io/library/rust:1.82-alpine3.18: not found
[ERROR] Failed to build builder image

Seems like this base image is not available on DockerHub. Can you choose a different base image, preferably the latest stable ones.

Also, did you try building these images locally? If not, can you please try to build the images locally before pushing the changes.

@hulxv
Copy link
Collaborator Author

hulxv commented Oct 10, 2025

@stark-3k it works now

@stark-3k
Copy link

stark-3k commented Nov 8, 2025

Getting this when running ./docker-setup.sh start on my mac:

 ✘ bitcoind Error no matching manifest for linux/arm64/v8 in the manifest list entries: no match for platform in manifest...                 2.6s 
Error response from daemon: no matching manifest for linux/arm64/v8 in the manifest list entries: no match for platform in manifest: not found
[ERROR] Failed to start Coinswap stack

Likely the alpine tag of bitcoin does not support arm, you can use the default debian based image

Copy link

@stark-3k stark-3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add docker-compose.generated.yml to gitignore

@hulxv hulxv requested a review from stark-3k November 12, 2025 18:36
@hulxv hulxv force-pushed the feat/dockerfile branch 3 times, most recently from 7b97c06 to 62dbc78 Compare November 14, 2025 23:31
@hulxv
Copy link
Collaborator Author

hulxv commented Nov 14, 2025

Getting this when running ./docker-setup.sh start on my mac:

 ✘ bitcoind Error no matching manifest for linux/arm64/v8 in the manifest list entries: no match for platform in manifest...                 2.6s 
Error response from daemon: no matching manifest for linux/arm64/v8 in the manifest list entries: no match for platform in manifest: not found
[ERROR] Failed to start Coinswap stack

Likely the alpine tag of bitcoin does not support arm, you can use the default debian based image

I tried many solutions to solve this error. can you give me more information about it? all logs

the issue doesn't come from Alpine. It supports arm64v8. Maybe it comes from a different thing

@mojoX911
Copy link

@stark-3k @hulxv Can we use these Docker to spawn makers and bitcoind for the demo easily? That would be really helpful if we could use this for platform-agnostic quick setups for maker and bitcoind backend.

We can boost priority for this PR and would be good to get it in asap. But it needs the following:

  • One click deployment of a maker server + bitcoind node, and connect them with each other.
  • Expose the maker rpc port to local machine to connect with maker-cli.
  • Expose the bitcoind rpc and zmq port to connect to taker app.

I am not sure whats the current state of this PR. But if we can do that, setting the backend for the demo in users machine will be very smooth.

@hulxv
Copy link
Collaborator Author

hulxv commented Nov 19, 2025

Can we use these Docker to spawn makers and bitcoind for the demo easily?

Yes, we can use it. The demo will contain multiple containers that run with each other. After merging this PR, we will need to finalize the demo by making some scripts for it, like what we did here, but for deployment.

We can boost priority for this PR and would be good to get it in asap. But it needs the following:

  • One click deployment of a maker server + bitcoind node, and connect them with each other.

  • Expose the maker rpc port to local machine to connect with maker-cli.

  • Expose the bitcoind rpc and zmq port to connect to taker app.

All these will be implemented in another PR because we need to finish this first.

I am not sure whats the current state of this PR. But if we can do that, setting the backend for the demo in users machine will be very smooth.

Currently, the PR is ready, but @stark-3k faced some problem with his machine (macos, arm64) due to we used an image for bitcoind that doesn't support arm64 and I think I fixed them, but I am waiting till he tries it on his machine to make sure that everything is going well.

Also, I am working now to fix the broken CI. After all of that, the PR will be ready to merge without any problems.

@mojoX911
Copy link

mojoX911 commented Nov 24, 2025

Changes needed as discussed:

  • Create a standalone bitcoin.conf file with all required configurations, for all networks. Inside docker-compose start bitcoind -network, to start for user user-defined network. Default: signet. Keep this file in doc/bitcoin.conf file in project repo. Use it for docker by copying it.
  • Create a pipeline to automatically update a makerd binary in docker hub, following the corelib master branch. Pull this binary in docker compose instead of compiling from scratch. Also add the taker binary too.
  • When starting the makerd server, the maker wallet will promt for a password. Figure out a way to provide a password in docker compose to makerd while starting up. This password could be a user input and it is used for wallet encrypt/decrypt. Empty password means a cleartext wallet.
  • Remove the redundant docker images, test and tracker.

Copy link

@mojoX911 mojoX911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

Copy link

@stark-3k stark-3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

@mojoX911 mojoX911 merged commit 23dc67e into citadel-tech:master Nov 26, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants